<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@include file="/WEB-INF/webpage/common/taglibs.jspf"%>
<!DOCTYPE html>
<html>
<head>
  <title>项目信息表列表</title>
  <meta name="decorator" content="list"/>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <html:css  name="iCheck,Validform,jquery-ztree,easy-ui"/>
  <html:js  name="iCheck,Validform,jquery-ztree,easy-ui,public-js,common-custom,activiti-js"/>
  <style type="text/css">.row{margin:0;}</style>
  <script type="text/javascript" src="${staticPath}/common/js/curdtools_jqgrid_extend.js"></script>
  <script type="text/javascript" src="${staticPath}/modules/activiti/js/workflow.js"></script>
</head>
<body title="项目信息表">
<div class="easyui-layout" id="cc" style="width:100%;">
	<div data-options="region:'center'" title="项目信息表">
		<grid:grid id="eqProjectInfoGridId" url="${adminPath}/sbfb/eqprojectinfo/ajaxList"  shrinkToFit="false" sortable="false">
			<grid:column label="sys.common.key" hidden="true"   name="id" width="100"/>
		    <grid:column label="项目名称" width="200" name="name"  query="true"  queryMode="input"  condition="like" />
		    <grid:column label="项目编号"  width="100" name="code"  query="true"  queryMode="input"  condition="like" />
		    <grid:column label="项目经理" width="100" name="manager" />
		    <grid:column label="联系人" width="100" name="contact" />
		    <grid:column label="项目来源" width="100" name="source" />
		    <grid:column label="项目规模" width="100" name="prjectScale" />
		    <grid:column label="管理模式" width="100" name="manageMode" />
		    <grid:column label="项目状态" width="100" name="prjectStatus" />
		    <grid:column label="管控模式" width="100" name="mcontrolMode" />
		    <grid:column label="行业" width="100" name="trade" />
		    <grid:column label="地址" width="100" name="address" />
		    <grid:column label="省份" width="100" name="province" />
		    <grid:column label="地市" width="100" name="city"   />
		    <grid:column label="项目类型" width="100" name="projectType" />
		    <grid:column label="工期" width="100" name="projectTimeLimit" />
		    <grid:column label="拟竣工日期" width="100" name="finishDatePlan" />
		    <grid:column label="竣工日期" width="100" name="finishDate" />
		    <grid:column label="拟开式日期" width="100" name="startDatePlan" />
		    <grid:column label="开式日期" width="100" name="startDate" />
		    <grid:column label="所属组织" width="100" name="orgName" />
		    <grid:column label="核算组织" width="100" name="orgAdjustAccounts" />
		    <grid:column label="管理单位" width="100" name="manageUnit" />
		    <grid:column label="成本模式" width="100" name="costMode" />
		    <grid:column label="纳税方式" width="100" name="taxMode" />
<%-- 改为坐标管理页面管理		    
			<grid:column label="经度" width="100" name="longtitude" />
		    <grid:column label="纬度" width="100" name="latitude" /> 
--%>
		    <grid:column label="项目描述"  name="projectDesc" />
			<shiro:hasPermission name="sbfb:eqprojectinfo:create">
				<grid:toolbar function="create"/>
			</shiro:hasPermission>
			<shiro:hasPermission name="sbfb:eqprojectinfo:update">
				<grid:toolbar function="update1"  title="修改" btnclass="btn-fa-file-text-o"/>
			</shiro:hasPermission>
			<shiro:hasPermission name="sbfb:eqprojectinfo:delete">
				<grid:toolbar function="delete"/>
			</shiro:hasPermission>
			<grid:toolbar function="coordinateManage" title="坐标管理"/>
			
			<grid:toolbar function="search"/>
			<grid:toolbar function="reset"/>
		</grid:grid>
	</div>
</div>
<script>
function coordinateManage(title,b,gridId,width, height,callBack){
	var rowsData = $("#"+gridId).jqGrid('getGridParam','selarrrow');
	var multiselect=$("#"+gridId).jqGrid('getGridParam','multiselect');
	var rowData= $("#"+gridId).jqGrid('getGridParam','selrow');
	if(!multiselect){
		if(rowData){
			  rowsData[0]=rowData;
		}
	}
    if (!rowsData || rowsData.length==0) {
	    top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
		return; 
	}
    if (rowsData.length>1) {
    	top.layer.alert('只能选择一条数据!', {icon: 0, title:'警告'});
		return;
	}

    var rowJson = $("#" + gridId).jqGrid('getRowData', rowsData[0]);
    var id = changeID(rowJson.id);
    var name = changeID(rowJson.name);
    var url= '${adminPath}/xmgl/eqprojectcoordinates/list?projectId='+id+'&projectName='+name;

    openDialog(title,url,gridId,'80%', '80%',callBack);  
	
}
function update1(title,b,gridId,width, height,callBack){
	var rowsData = $("#"+gridId).jqGrid('getGridParam','selarrrow');
	var multiselect=$("#"+gridId).jqGrid('getGridParam','multiselect');
	var rowData= $("#"+gridId).jqGrid('getGridParam','selrow');
	if(!multiselect){
		if(rowData){
			  rowsData[0]=rowData;
		}
	}
    if (!rowsData || rowsData.length==0) {
	    top.layer.alert('请至少选择一条数据!', {icon: 0, title:'警告'});
		return; 
	}
    if (rowsData.length>1) {
    	top.layer.alert('只能选择一条数据!', {icon: 0, title:'警告'});
		return;
	}
    var id = rowsData[0];
    id = changeID(id);
    var url= '${adminPath}/sbfb/eqprojectinfo/'+id+'/update';
    openDialog(title,url,gridId,'80%', '80%',callBack);    

}
function changeID(id){
	id = id.replace("=","~").replace("/","!").replace('+', '.');
	return id;
}
</script>
</body>
</html>